<?php
/**
 * 错误日志信息视图文件
 */

use yii\helpers\ArrayHelper;
use yii\helpers\Html;
use yii\grid\GridView;

/* @var $this yii\web\View */

$this->title = Yii::t('app', '错误日志');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="category-index">
    <section class="panel panel-default">
        <header class="panel-heading font-bold">日志信息</header>
        <div class="panel-body">
            <form class="form-horizontal ajax-submit" method="post"action="/error-log/edit">
                <div class="form-group">
                    <label class="col-sm-1 control-label">id</label>
                    <div class="col-sm-2">
                        <input type="text" class="form-control" readonly name="id" value="<?= \yii\helpers\ArrayHelper::getValue($info, 'id')?>">
                        <span class="help-block m-b-none"></span><!--注释表单-->
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-1 control-label">信息</label>
                    <div class="col-sm-10">
                        <span class="help-block m-b-none"><?= \yii\helpers\ArrayHelper::getValue($info, 'message')?></span><!--注释表单-->
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-1 control-label">文件</label>
                    <div class="col-sm-10">
                        <span class="help-block m-b-none"><?= \yii\helpers\ArrayHelper::getValue($info, 'file')?></span><!--注释表单-->
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-1 control-label">行：列</label>
                    <div class="col-sm-10">
                        <span class="help-block m-b-none"><?= \yii\helpers\ArrayHelper::getValue($info, 'line')?>：<?= \yii\helpers\ArrayHelper::getValue($info, 'col')?></span><!--注释表单-->
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-1 control-label">类型</label>
                    <div class="col-sm-10">
                        <span class="help-block m-b-none"><?= \yii\helpers\ArrayHelper::getValue($info, 'type')?></span><!--注释表单-->
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-1 control-label">trace</label>
                    <div class="col-sm-10">
                        <span class="help-block m-b-none"><pre><?= var_export(json_decode(\yii\helpers\ArrayHelper::getValue($info, 'trace'), true))?></pre></span><!--注释表单-->
                    </div>
                </div>
                <div class="line line-dashed line-lg pull-in"></div>

                <div class="form-group">

                    <label class="col-sm-1 control-label">状态</label>
                    <div class="col-sm-2 radio">
                        <label>
                            <input type="radio" name="is_solve" value="0" checked="">未解决
                        </label>
                        <label>
                            <input type="radio" name="is_solve" value="1" <?= ArrayHelper::getValue($info, 'is_solve')? 'checked':''?>>解决
                        </label>
                    </div>
                </div>

                <div class="line line-dashed line-lg pull-in"></div>

                <div class="form-group">
                    <div class="col-sm-4 col-sm-offset-2">
                        <button type="button" class="btn btn-default">取消</button>
                        <button type="submit" class="btn btn-primary">保存</button>
                    </div>
                </div>
                <input type="hidden" value="<?php echo Yii::$app->request->csrfToken; ?>" name="<?= Yii::$app->request->csrfParam?>" >
            </form>
        </div>

        <div class="panel-heading font-bold">错误访问记录</div>
        <div class="panel-body">
            <table class="table table-border table-hover">
                <thead>
                <tr>
                    <th>id</th>
                    <th>IP</th>
                    <th>访问时间</th>
                    <th>浏览器</th>
                    <th>系统</th>
                </tr>
                </thead>
                <tbody>
                <?php foreach($recordList as $item):?>
                    <tr>
                        <td><?= ArrayHelper::getValue($item, 'id')?></td>
                        <td><?= ArrayHelper::getValue($item, 'ip')?></td>
                        <td><?= ArrayHelper::getValue($item, 'create_time')?></td>
                        <td><?= ArrayHelper::getValue($item, 'user_agent')?></td>
                        <td><?= ArrayHelper::getValue($item, 'system')?></td>
                    </tr>
                <?php endforeach;?>
                </tbody>

            </table>
        </div>
    </section>



</div>